package com.hechao.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hechao.dao.UserDao;
import com.hechao.domain.User;
import com.hechao.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceimpl extends ServiceImpl<UserDao,User> implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public List<User> queryAll() {
        return userDao.selectAll();
    }

    @Override
    public User queryById(Integer id) {
        return userDao.selectById(id);
    }

    @Override
    public User loginByUsernameAndPwd(String username, String password) {
        return userDao.selectByUsernameAndPwd(username,password);
    }

    @Override
    public Boolean deleteById(Integer id) {
        return userDao.deleteById(id);
    }

    @Override
    public Boolean update(User user) {
        return userDao.update(user);
    }

    @Override
    public int insert(User user) {
        return userDao.insert(user);
    }
}
